//
// Created by edward on 23-3-16.
//

#ifndef LEARNOPENGL_RENDERER_H
#define LEARNOPENGL_RENDERER_H

#include "global.h"
#include <memory>
#include "Shader.h"
#include "Model.h"
#include "Texture.h"
#include "Camera.h"
#include "Mouse.h"

class Renderer {
public:
    explicit Renderer(int w = 800, int h = 600);
    ~Renderer();

    void render();

    void init();

    void loadShader();

    void loadModel();

    void loop();

    void processInput(float deltaTime);

    void mouseCallback(float xoffset, float yoffset);

    void setProjection(float fovOffset = 0);

private:

    void draw();

    void loadLight(glm::vec3 lightPos);

    GLFWwindow* window;
    int width, height;
    float fov;
    std::unique_ptr<Shader> shader, lightShader;
    std::unique_ptr<Model> model, light;
    std::unique_ptr<Camera> camera;
    std::unique_ptr<Mouse> mouse;
};


#endif //LEARNOPENGL_RENDERER_H
